<template>
	<view class="bg-white" style="height: 100vh">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">待入职详情</block>
		</cu-custom>
		<view style="padding: 15px 30px;background-color: #c5d6ff;font-size: 14px;font-weight: 500;color: #7A7D91;">
			读证时间：{{dataObj.createTime}}
		</view>
		<view style="padding: 5px 20px; background-color: rgba(249, 249, 249, 1);">
			<!-- <view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					照片
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<image :src="dataObj.avatar" style="width: 79.88px;height: 110.44px;margin-right: 5px;" />
				</view>
			</view> -->
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					创建时间
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.createTime}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					姓名
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.realname}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					性别
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.sex_dictText}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					年龄
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.age}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					民族
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.nation}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					籍贯
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.nativePlace}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					公民身份证号码
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.idCard}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					出生日期
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<!-- {{dataObj.birthday.replaceAll('-','/')}} -->
					{{dataObj.birthday}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					住址
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.idCardAddress}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					签发机关
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.idCardIssue}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					有效期限
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					<!-- {{dataObj.idCardValidPeriod.replaceAll('-','/')}} -->
					{{dataObj.idCardValidPeriod}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					身份类别
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.identityCategory_dictText}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					公司
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.company_dictText}}
				</view>
			</view>
			<view class="flex" style="width: 300px;">
				<view class="flex-sub padding-sm margin-xs radius textStyle">
					地址
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.companyAddress}}
				</view>
			</view>
			<!-- <view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #000000;font-weight: bold;font-size: 30rpx;">
						审批记录
					</text>
				</view> -->
				<!-- <view style="border-radius: 10px;margin-top: 10px;">
					<view class="cu-timeline" style=" background-color: rgba(249, 249, 249, 1);" v-for="(item,index) in approvalRecords">
						<view class="cu-item text-green cuIcon-roundcheckfill">
							<view style="display: flex;color: #000000;">
								<view style="width: 25px;">
									<text
										style="margin-left: -18px;margin-top: 5px;display: block;font-weight: bold;">{{item.currentNode_dictText}}</text>
								</view>
								<view style="margin-left: 20px;">
									<view>
										<text style="font-size: 28rpx;">{{item.approver_dictText}}</text>
										<text
											style="display: inline-block;padding: 2px;background-color: #d9d9d9;border-radius: 5px;font-size: 16rpx;margin-left: 10px;color: #a1a1a1;">{{item.remark}}</text>
										<text
											style="display: inline-block;padding: 4rpx 10rpx;background-color: #34b483;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #FFFFFF;">{{item.approvalStatus_dictText}}</text> -->
<!--										<text v-show="item.approvalStatus_dictText=='提交'"-->
<!--											style="display: inline-block;padding: 4rpx 10rpx;background-color: #D9D9D9;border-radius: 5px;font-size: 16rpx;margin-left: 15px;color: #A0A0A0;">{{item.approvalStatus_dictText}}</text>-->
									<!-- </view>
									<view>
										<text style="font-size: 24rpx;">{{item.manager}}</text>
										<text
											style="font-size: 20rpx;color: #c7c7c7;margin-left: 15px;">{{item.createTime}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view> -->
			</view>
		</view>
	</view>
</template>


<script>
	import configService from '@/common/service/config.service.js'
	export default {
		data() {
			return {

				isShowFun: false,
				dataObj: {
					// id: '401518243333144500',
					// createTime: '',
					// avatar: '',
					// name: '段阵阵',
					// sex: '男',
					// age: '25',
					// nation: '汉族',
					// idCard: '38494959986859',
					// birthday: '1995-05-04',
					// inAddress: '福建省福州市仓山区仓山万达',
					// signingOrganization: '福州市公安局',
					// validity: '2025-08-06',
					// type: '首次入厂',
					// company: '福建省立华智纺',
					// address: '福建省福州市长乐区空港工业区',
				},
				approvalRecords: [{
					currentNode_dictText: '总经理',
					approver_dictText: '陈婷婷',
					remark: '手写区域',
					approvalStatus_dictText: '同意',
					manager: '企管',
					createTime: '2023/10/10 12:00'
				}]
			}
		},
		mounted() {

		},
		computed: {

		},
		onLoad: function(options) {
			this.dataObj.id = options.id;
			// 在这里可以使用获取到的 id 参数进行后续操作
		},
		created() {
			this.getDetail()
		},
		methods: {
			getFileAccessHttpUrl(avatar, subStr) {
				if (!subStr) subStr = 'http'
				if (avatar && avatar.startsWith(subStr)) {
					return avatar;
				} else {
					return configService.staticDomainURL + "/" + avatar;
				}
			},
			getDetail() {
				console.log("获取详情")
				this.$http.get(
						"/crm_pending_employment_application/crmPendingEmploymentApplication/queryEmploymentApplicationDetail/" +
						this.dataObj.id)
					.then(res => {
						if (res.data.success) {
							console.log('待入职详情',res)
							this.dataObj = res.data.result
							this.dataObj['avatar'] = this.getFileAccessHttpUrl(this.dataObj['avatar'])
							console.log(this.dataObj['avatar'])
                            this.approvalRecords = this.dataObj.approvalRecords
						}
					})
			},
			hideFun() {
				this.isShowFun = false
			},
		}
	}
</script>

<style>
	.nav-right-image {
		width: 80rpx;
		height: 80rpx;
		margin-left: 15px;
	}

	.padding-sm {
		padding: 5px;
	}
	.cu-timeline>.cu-item::before {
	    font-family: "cuIcon";
	    display: block;
	    position: absolute;
	    top: 19px;
	    z-index: 9;
	    background-color: rgba(249, 249, 249, 1);
	    width: 26px;
	    height: 26px;
	    text-align: center;
	    border: none;
	    line-height: 26px;
	    left: 10px;
	}
	.cu-timeline>.cu-item::after {
	    content: "";
	    display: block;
	    position: absolute;
	    width: 1px;
	    background-color: #ddd;
	    left: 22px;
	    height: 100%;
	    top: 0;
	    z-index: 8;
	}
</style>
